package org.etom.connector.service;

import org.etom.connector.datatypes.IMoodleConnection;

/**
 * The Moodle connection id registered as OSGi service.
 * It is an entry point to Moodle server.
 */
public interface MoodleConnector {
  
  /**
   * The method returns a new connection to Moodle server.
   * The returned connection is not validated.
   * 
   * @param moodleUrl - the URL to Moodle server
   * @param rpcServerUrl - the path to the RPC server
   * @param username - the user name which will be used for the authentication
   * @param password - the user password which will be used for the authentication
   * 
   * @return - the Moodle connection
   * 
   * @throws ConnectorException is thrown if the server urlor RPC url is not valid
   */
  public IMoodleConnection getConnection(
      String moodleUrl, String rpcServerUrl, String username, String password) throws ConnectorException;
  
}
